      MODULE mod_kinds
!
!svn $Id$
!================================================== Hernan G. Arango ===
!  Copyright (c) 2002-2018 The ROMS/TOMS Group                         !
!    Licensed under a MIT/X style license                              !
!    See License_ROMS.txt                                              !
!=======================================================================
!
#ifdef ESMF_LIB
        USE ESMF
!
#endif
        implicit none
!
#ifdef ESMF_LIB
!!      integer, parameter :: i1b= ESMF_KIND_I1                !  8-bit
        integer, parameter :: i1b= SELECTED_INT_KIND(1)        !  8-bit
!!      integer, parameter :: i2b= ESMF_KIND_I2                !  8-bit
        integer, parameter :: i2b= SELECTED_INT_KIND(2)        !  8-bit
        integer, parameter :: i4b= ESMF_KIND_I4                ! 16-bit
        integer, parameter :: i8b= ESMF_KIND_I8                ! 32-bit
        integer, parameter :: c8 = SELECTED_REAL_KIND(6,30)    ! 32-bit
        integer, parameter :: r4 = ESMF_KIND_R4                ! 32-bit
        integer, parameter :: r8 = ESMF_KIND_R8                ! 64-bit
#else
        integer, parameter :: i1b= SELECTED_INT_KIND(1)        !  8-bit
        integer, parameter :: i2b= SELECTED_INT_KIND(2)        !  8-bit
        integer, parameter :: i4b= SELECTED_INT_KIND(4)        ! 16-bit
        integer, parameter :: i8b= SELECTED_INT_KIND(8)        ! 32-bit
        integer, parameter :: c8 = SELECTED_REAL_KIND(6,30)    ! 32-bit
        integer, parameter :: r4 = SELECTED_REAL_KIND(6,30)    ! 32-bit
        integer, parameter :: r8 = SELECTED_REAL_KIND(12,300)  ! 64-bit
#endif
#if defined SUN || defined AIX || defined NEC || defined SGI || \
    defined CRAYX1 || defined DEC
        integer, parameter :: r16 = SELECTED_REAL_KIND(24,270) !128-bit
#else
        integer, parameter :: r16 = SELECTED_REAL_KIND(15,300) !128-bit
#endif

      END MODULE mod_kinds
